package handler.heartbeat;

import client.SwordHeartBeatClient;
import handler.client.SwordClientHandler;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;

import java.nio.charset.StandardCharsets;

public class HeartBeatDefaultHandler implements HeartBeatHandler {
	@Override
	public void handle(ChannelFuture channelFuture) throws InterruptedException {
		while (true) {
			Channel channel = channelFuture.channel();
			channel.writeAndFlush(SwordHeartBeatClient.HEART_VALUE);
			Thread.sleep(SwordHeartBeatClient.heartBeatInterval);
		}
	}

}
